Skip to content

Conversation

ExaltZephyr
Copy link
Contributor

@ExaltZephyr ExaltZephyr commented Sep 28, 2025

This PR introduces support for MSPI driver on STM32, enabling functionality APIs for MSPI host controllers.

  1. mspi_stm32 driver

    • support xspi

    • tested using stm32h573i_dk board

    • functionalities:

      • Indirect Mode (read, write and erase).
      • DTR support.
      • Memory map mode (read and write).
      • xip configuration.
      • DMA Mode
  2. ospi_stm32 driver

    • support octospi
    • tested using stm32h735g_disco and b_u585i_iot02a
    • functionalities:
      • Indirect mode (read, write and erase)
      • DTR support
      • Memory map mode (read b_u585i_iot02a board)
      • xip configuration
      • DMA trasfer (b_u585i_iot02a board)
  3. mspi_stm32_qspi driver

    • support quadspi
    • tested using arduino_giga_r1/stm32h747xx/m7
    • functionalities:
      • Indirect mode (read, write and erase) with MSPI_IO_MODE_SINGLE
      • Indirect mode (read, write and erase) with MSPI_IO_MODE_QUAD_1_1_4
      • Memory map mode (read)
      • DMA transfer: not supported yet

@ExaltZephyr ExaltZephyr force-pushed the stm32-mspi-support branch 8 times, most recently from 834dc73 to 7e8241c Compare September 29, 2025 11:59
@FRASTM FRASTM mentioned this pull request Sep 30, 2025
4 tasks
@ExaltZephyr ExaltZephyr force-pushed the stm32-mspi-support branch 6 times, most recently from ed327ea to a09a921 Compare October 2, 2025 14:03
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename to dts/bindings/mspi/st,stm32-xspi-controller.yaml MSPI is the subsytem api and XSPI is the ST IP name.
Apply everywhere (driver files, ....) on this PR..


}

static int flash_stm32_xspi_dma_init(DMA_HandleTypeDef *hdma, struct stream *dma_stream)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/flash_stm32_xspi_dma_init/mspi_stm32_xspi_dma_init

For example
dma-names = "tx_rx";

ssht-enable:
Copy link
Member

@erwango erwango Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the three IPs, these bindings will have to propose the same configuration options as the union of dts/bindings/memory-controllers/st,stm32-xspi-psram.yaml and dts/bindings/flash_controller/st,stm32-xspi-nor.yaml

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this may potentially be done as a follow up PR

@ExaltZephyr ExaltZephyr force-pushed the stm32-mspi-support branch 9 times, most recently from e0849ca to 806f0f8 Compare October 6, 2025 12:23
@erwango erwango requested a review from Copilot October 6, 2025 12:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces MSPI (Multi-SPI) driver support for STM32 microcontrollers, enabling support for XSPI, OSPI, and QSPI peripherals. The implementation provides a unified MSPI interface with different STM32 SPI variants while maintaining compatibility with the existing Zephyr MSPI API.

  • Adds three new STM32 MSPI drivers: mspi_stm32_xspi, mspi_stm32_ospi, and mspi_stm32_qspi
  • Implements comprehensive MSPI functionality including indirect mode, memory-mapped mode, XIP configuration, and DMA support
  • Provides device tree bindings and sample configurations for multiple STM32 boards

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
drivers/mspi/mspi_stm32_xspi.c XSPI controller driver implementation with full MSPI functionality
drivers/mspi/mspi_stm32_ospi.c OSPI controller driver implementation supporting octal SPI operations
drivers/mspi/mspi_stm32_qspi.c QSPI controller driver implementation for quad SPI operations
drivers/mspi/mspi_stm32.h Common header file with shared definitions and structures
dts/bindings/mspi/*.yaml Device tree binding files for XSPI, OSPI, and QSPI controllers
drivers/mspi/Kconfig.stm32 Configuration options for STM32 MSPI drivers
samples/drivers/mspi/mspi_flash/boards/*.overlay Board-specific overlay files for sample applications

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


/*
* **************************************************************************
* MSPI flash controller driver for stm32 serie with multi-SPI periherals
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'periherals' to 'peripherals' and 'serie' to 'series'.

Suggested change
* MSPI flash controller driver for stm32 serie with multi-SPI periherals
* MSPI flash controller driver for stm32 series with multi-SPI peripherals

Copilot uses AI. Check for mistakes.

This commit adds the main DTS configurations required
to enable MSPI/OSPI/QSPI support on STM32.

Signed-off-by: Sara Touqan <[email protected]>
Signed-off-by: Sarah Younis <[email protected]>
Signed-off-by: Mohammad Odeh <[email protected]>
@ExaltZephyr ExaltZephyr force-pushed the stm32-mspi-support branch 8 times, most recently from 88b499e to 88f79c5 Compare October 7, 2025 13:51
This commit introduces support for the mspi and ospi drivers on STM32,
enabling functionality APIs for MSPI/OSPI/QSPI host controllers..

Signed-off-by: Sara Touqan <[email protected]>
Signed-off-by: Sarah Younis <[email protected]>
Signed-off-by: Mohammad Odeh <[email protected]>
this commit enables building and running the sample on
stm32h573i_dk board,stm32h735g_disco board, arduino_giga_r1
board, and  b_u585i_iot02a board by providing the required overlay
and configuration updates.

Signed-off-by: Sara Touqan <[email protected]>
Signed-off-by: Sarah Younis <[email protected]>
Signed-off-by: Mohammad Odeh <[email protected]>
Copy link

sonarqubecloud bot commented Oct 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants